package com.lhy.common.web.entity;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 与前一个条件的连接关系
 */
public enum ConditionEnum {
    AND("and"),

    OR("or"),

    BY("by");

    private String value;

    ConditionEnum(String value) {
        this.value = value;
    }

    @Override
    @JsonValue
    public String toString() {
        return String.valueOf(value);
    }

    @JsonCreator
    public static ConditionEnum fromValue(String text) {
        for (ConditionEnum b : ConditionEnum.values()) {
            if (String.valueOf(b.value).equals(text)) {
                return b;
            }
        }
        return null;
    }
}
